package com.egoo.ticket.server.dao;

import com.egoo.ticket.server.pojo.vo.InteractiveDataVo;
import com.egoo.ticket.server.pojo.vo.WorkOrderTypeFiledVo;
import com.egoo.ticket.server.pojo.vo.WorkOrderTypeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@Component
public interface WorkOrderTypeDao {

	/**
	 * TODO 获取工单类型列表
	 *
	 * @param searchMap 1
	 * @author: victor_tang
	 * @createtime: 2020/2/16 14:43
	 * @return: java.utils.List<com.egoo.ews.service.vo.WorkOrderTypeVo>
	 */
	List<WorkOrderTypeVo> selectWorkOrderTypeListByCondition(Map<String, Object> searchMap);

	/**
	 * 创建
	 * @param workOrderType
	 * @return
	 */
	Integer create(WorkOrderTypeVo workOrderType);

	/**
	 * 查询列表
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	List<WorkOrderTypeVo> selectAll(@Param("currentPage") Integer currentPage,
                                    @Param("pageSize") Integer pageSize);

	/**
	 * 查询数量
	 * @return
	 */
	Integer selectTotal();

	/**
	 * TODO 通过名字进行分页
	 * @param name
	 * @param userId
	 * @param tenantId
	 * @return
	 */
	List<WorkOrderTypeVo> selectByName(@Param("name") String name,
                                       @Param("userId") String userId,
                                       @Param("tenantId") String tenantId);

	/**
	 * 查询对应id的流程
	 * @param id
	 * @return
	 */
	WorkOrderTypeVo selectById(Long id);

	/**
	 * 查询工单类型字段列表
	 * @param id
	 * @return
	 */
	List<WorkOrderTypeFiledVo> selectAllFiledByWorkOrderTypeId(@Param("id") Long id);

	/**
	 * 更新启用状态
	 * @param workOrderTypeVo
	 * @return
	 */
	Integer updateUseStatus(WorkOrderTypeVo workOrderTypeVo);

	/**
	 * /更新工单类型的content
	 * @param workOrderTypeVo
	 * @return
	 */
	Integer updateContent(WorkOrderTypeVo workOrderTypeVo);

	/**
	 * 更新编辑状态
	 * @param workOrderTypeVo
	 * @return
	 */
	Integer updateEditStatus(WorkOrderTypeVo workOrderTypeVo);

	/**
	 * 更新删除状态
	 * @param workOrderTypeVo
	 * @return
	 */
	Integer updateDeleteStatus(WorkOrderTypeVo workOrderTypeVo);

	/**
	 * TODO 批量更新删除状态
	 * @author: victor_tang
	 * @createtime: 2020/5/20 14:29
	 * @param updateMap 1
	 * @return: java.lang.Integer
	 */
	Integer batchUpdateDeleteStatusBatch(Map<String, Object> updateMap);



//	List<WorkOrderTypeVo> selectByEqualsName(String name);

//	List<WorkOrderTypeVo> selectAllNewable(@Param("userId") String userId);

	/**
	 * 查询所有流程名列表
	 * @param tenantId
	 * @return
	 */
	List<WorkOrderTypeVo> selectAllName(@Param("tenantId") String tenantId);

	/**
	 * TODO
	 * @param tenantId
	 * @return
	 */
	List<InteractiveDataVo> selectAllWorkOrderTypeName(@Param("tenantId") String tenantId);

	/**
	 * 获取所有可选择的工单类型(包含全部类型)
	 * @param tenantId
	 * @return
	 */
	List<InteractiveDataVo> selectAllSelectable(@Param("tenantId") String tenantId);

	/**
	 * 更新工单类型
	 * @param workOrderTypeVo
	 * @return
	 */
	Integer updateWorkOrderType(WorkOrderTypeVo workOrderTypeVo);

    WorkOrderTypeVo selectByTypeName(@Param("workOrderTypeName") String workOrderTypeName,
									 @Param("tenantId") String tenantId);

//	List<WorkOrderTypeVo> getAllType(@Param("tenantId")String tenantId);
}
